/// Calculates the minimum number of coins needed to make the given amount
///
/// # Parameters
/// - `amount` - The amount of money
///
/// # Returns
/// Returns the minimum number of coins needed
pub fn dp_rec_mc(amount: u32) -> u32 {
    // Define the available coin denominations
    let coins = [1, 2, 5, 10, 20, 30, 50, 100];
    
    // Initialize a vector to store the minimum coins needed for each amount
    // Set the initial value to amount + 1, which is an impossible high value
    let mut dp = vec![amount + 1; (amount + 1) as usize];
    
    // Base case: 0 coins are needed to make the amount 0
    dp[0] = 0;

    // Iterate through all amounts from 1 to the given amount
    for i in 1..=amount {
        // Check each coin denomination
        for &coin in &coins {
            // If the coin can be used (i.e., it is less than or equal to the current amount)
            if i >= coin {
                // Update the dp array with the minimum coins needed
                dp[i as usize] = dp[i as usize].min(dp[(i - coin) as usize] + 1);
            }
        }
    }

    // Return the minimum number of coins needed for the given amount
    dp[amount as usize]
}